//
//  ComposeTextView.swift
//  weibo1
//
//  Created by changhongliang on 2017/8/11.
//  Copyright © 2017年 richinfo. All rights reserved.
//

import UIKit

class ComposeTextView: KeyboardTextView {
    override init(frame: CGRect, textContainer: NSTextContainer?) {
        super.init(frame: frame, textContainer: textContainer)
        setupUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        setupUI()
    }
    
    func setupUI()
    {
        //1.添加子控件
        addSubview(placeholderLabel)
//        addSubview(wordsNumberLabel)
        //2.布局子控件
        placeholderLabel.snp.makeConstraints { (make) in
            make.left.equalTo(self).offset(5)
            make.top.equalTo(self).offset(8)
        }
        placeholderLabel.sizeToFit()
//        wordsNumberLabel.snp.makeConstraints { (make) in
//            make.right.equalTo(<#T##other: ConstraintRelatableTarget##ConstraintRelatableTarget#>)
//        }
//    
        
        //3.隐藏滚动条
        self.showsVerticalScrollIndicator = true
        self.showsHorizontalScrollIndicator = false
    
    }
    
    //MARK: - 懒加载
    lazy var placeholderLabel:UILabel = {
        let lb = UILabel()
        lb.text = "分享新鲜事..."
        lb.textColor = UIColor.gray
        lb.font = self.font
        return lb
    }()
    
    
}


